<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<style type="text/css">
    table#declarationTable table {
        border: 0;
        margin: 0;
        border-collapse: collapse;
        border-spacing: 0;
        width: 100%;
    }

    table#declarationTable {
        border: 0;
        margin: 0;
        border-collapse: collapse;
        border-spacing: 0;
        width: 100%;
    }

    table#declarationTable th, table#declarationTable td {
        border: 1px solid;
        padding: 0;
    }
</style>
<script type="text/javascript">
    $(function () {
        var gross_weight_val = Math.ceil($("#gross_weight").text());
        var net_weight_val = Math.ceil($("#net_weight").text());
        $("#gross_weight").text(gross_weight_val);
        $("#net_weight").text(net_weight_val);
    });
</script>
<table id="declarationTable">
    <caption><h3>中华人民共和国海关出口货物报关单</h3></caption>
    <tbody>
    <tr>
        <td>出口口岸(<s:property value="declare.export_port_code"/>)<br/><s:property value="declare.export_port"/></td>
        <td>备案号<br/><s:property value="declare.record_id"/></td>
        <td>出口日期<br/></td>
        <td>申报日期<br/></td>
    </tr>
    <tr>
        <td>收发货人(<s:property value="declare.company_co"/>)<br/><s:property value="declare.company_name"/></td>
        <td colspan="3">
            <table>
                <tr>
                    <td style="border: 0;border-right: 1px solid;">运输方式<br/><s:property value="declare.transport_mode"/>
                    </td>
                    <td style="border: 0;border-right: 1px solid;">运输工具名称<br/><s:property value="declare.transport_na"/>
                    </td>
                    <td style="border: 0;">提运单号<br/></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>生产销售单位(<s:property value="declare.fahuo_company_co"/>)<br/><s:property value="declare.fahuo_company_name"/>
        </td>
        <td>贸易方式(<s:property value="declare.trade_mode_code"/>)<br/><s:property value="declare.trade_mode"/></td>
        <td>征免性质(<s:property value="declare.levymode_code"/>)<br/><s:property value="declare.levymode"/></td>
        <!-- 			<td> -->
        <%-- 				结汇方式<br/><s:property value="declare.lc_type"/> --%>
        <!-- 			</td> -->
        <td style="border: 0;border-right: 1px solid;">许可证号<br/><s:property value="declare.license_no"/></td>
    </tr>
    <tr>
        <td colspan="4">
            <table>
                <tr>

                    <td style="border: 0;border-right: 1px solid;">运抵国(地区)(<s:property
                            value="declare.arrived_country_code"/>)<br/><s:property value="declare.arrived_country"/>
                    </td>
                    <td style="border: 0;border-right: 1px solid;">指运港(<s:property
                            value="declare.arrived_port_code"/>)<br/><s:property value="declare.arrived_port"/></td>
                    <td style="border: 0;border-right: 1px solid;">境内货源地(<s:property
                            value="declare.goods_addr_code"/>)<br/><s:property value="declare.goods_addr"/></td>
                    <td style="border: 0;border-right: 1px solid;">贸易国(地区)(<s:property value="declare.trading_country"/>)<br/><s:property
                            value="declare.trading_country_code"/></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <table>
                <tr>
                    <%-- 						<td style="border: 0;border-right: 1px solid;">批准文号<br/><s:property value="declare.approval_no"/></td> --%>
                    <td style="border: 0;border-right: 1px solid;">成交方式<br/><s:property value="declare.deal_mode"/></td>
                    <td style="border: 0;border-right: 1px solid;">运费
                        <br/>
                        <s:property value="declare.freight1"/> /
                        <s:property value="declare.freight2"/> /
                        <s:property value="declare.freight3"/> /
                    </td>
                    <td style="border: 0;border-right: 1px solid;">保费
                        <br/>
                        <s:property value="declare.premium1"/> /
                        <s:property value="declare.premium2"/> /
                        <s:property value="declare.premium3"/> /
                    </td>
                    <td style="border: 0;">杂费
                        <br/>
                        <s:property value="declare.otherfee1"/> /
                        <s:property value="declare.otherfee2"/> /
                        <s:property value="declare.otherfee3"/> /
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <table>
                <tr>
                    <td style="border: 0;border-right: 1px solid;">合同协议号<br/><s:property value="declare.contract_no"/>
                    </td>
                    <td style="border: 0;border-right: 1px solid;">件数<br/><s:property value="declare.goods_count"/></td>
                    <td style="border: 0;border-right: 1px solid;">包装种类<br/><s:property value="declare.goods_package"/>
                    </td>
                    <td style="border: 0;border-right: 1px solid;">毛重(千克)<br/>
                        <label id="gross_weight">
                            <s:property value="declare.gross_weight"/>
                        </label>
                    </td>
                    <td style="border: 0;">净重(千克)<br/>
                        <label id="net_weight">
                            <s:property value="declare.net_weight"/>
                        </label>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <table>
                <tr>
                    <td style="border: 0;border-right: 1px solid;">集装箱号<br/><s:property value="declare.container_no"/>
                    </td>
                    <td style="border: 0;border-right: 1px solid;">随附单证<br/><s:property value="declare.suifudan"/></td>
                </tr>
            </table>
        </td>
    </tr>
    <!-- 		<tr> -->
    <!-- 			<td colspan="4"> -->
    <!-- 				<table> -->
    <!-- 					<tr> -->
    <!-- 						<td style="border: 0;border-right: 1px solid;">特殊关系确认<br> -->
    <%-- 							<s:if test='declare.special_relationship_confirm=="0"'>是</s:if> --%>
    <%-- 							<s:if test='declare.special_relationship_confirm=="1"'>否</s:if> --%>
    <!-- 						</td> -->
    <!-- 						<td style="border: 0;border-right: 1px solid;">价格影响确认<br> -->
    <%-- 							<s:if test='declare.price_impact_confirm=="0"'>是</s:if> --%>
    <%-- 							<s:if test='declare.price_impact_confirm=="1"'>否</s:if> --%>
    <!-- 						</td> -->
    <!-- 						<td style="border: 0;">支付特许权使用费确认<br> -->
    <%-- 							<s:if test='declare.payment_royaltils_confirm=="0"'>是</s:if> --%>
    <%-- 							<s:if test='declare.payment_royaltils_confirm=="1"'>否</s:if> --%>
    <!-- 						</td> -->
    <!-- 					</tr> -->
    <!-- 				</table> -->
    <!-- 			</td> -->
    <!-- 		</tr> -->
    <tr>
        <td colspan="4">
            标记唛码及备注：<s:property value="declare.remark"/><br/>
            随附单证<br/><s:property value="declare.suifudanValue"/>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <table>
                <tr>
                    <th style="border: 0;border-bottom: 1px solid;">项号</th>
                    <th style="border: 0;border-bottom: 1px solid;">商品编号</th>
                    <th style="border: 0;border-bottom: 1px solid;">商品名称、规格型号</th>
                    <th style="border: 0;border-bottom: 1px solid;">数量及单位</th>
                    <!-- 						<th style="border: 0;border-bottom: 1px solid;">最终目的国(地区)</th> -->
                    <th style="border: 0;border-bottom: 1px solid;">原产国</th>
                    <th style="border: 0;border-bottom: 1px solid;">单价</th>
                    <th style="border: 0;border-bottom: 1px solid;">总价</th>
                    <th style="border: 0;border-bottom: 1px solid;">币制</th>
                    <th style="border: 0;border-bottom: 1px solid;">征免</th>
                </tr>
                <s:iterator value="declare.commodities" status="st">
                    <tr>
                        <td style="border: 0;border-bottom: 1px dashed;">00<s:property value="#st.index+1"/></td>
                        <td style="border: 0;border-bottom: 1px dashed;"><s:property value="code_t"/></td>
                        <td style="border: 0;border-bottom: 1px dashed;">
                            <s:property value="name"/><br/>
                            <s:property value="goods_mode"/><br/>
                        </td>
                        <td style="border: 0;border-bottom: 1px dashed;">
                            <s:if test="unit == legal_unit">
                                <s:property value="count"/>
                                <s:property value="unit"/> <br/>
                                <s:property value="second_count"/>
                                <s:property value="second_unit"/><br/>
                            </s:if>
                            <s:elseif test="unit == second_unit">
                                <s:property value="count"/>
                                <s:property value="unit"/> <br/>
                                <s:property value="legal_count"/>
                                <s:property value="legal_unit"/><br/>
                            </s:elseif>
                            <s:elseif test="unit != '千克' &&　legal_unit　!= '千克' && second_unit != '千克'">
                                <s:property value="count"/>
                                <s:property value="unit"/> <br/>
                                <s:property value="legal_count"/>
                                <s:property value="legal_unit"/><br/>
                                <s:property value="second_count"/>
                                <s:property value="second_unit"/><br>
                                <s:property value="net_weight"/> KG
                            </s:elseif>
                            <s:else>
                                <s:property value="count"/>
                                <s:property value="unit"/> <br/>
                                <s:property value="legal_count"/>
                                <s:property value="legal_unit"/><br/>
                                <s:property value="second_count"/>
                                <s:property value="second_unit"/><br>
                            </s:else>
                        </td>
                        <td style="border: 0;border-bottom: 1px dashed;">
                            <s:property value=""/><br/>
                            <s:property value="destination"/>
                        </td>
                            <%-- 							<td style="border: 0;border-bottom: 1px dashed;"><s:property value="origin_country"/></td> --%>
                        <td style="border: 0;border-bottom: 1px dashed;"><s:property value="unit_price"/></td>
                        <td style="border: 0;border-bottom: 1px dashed;"><s:property value="total_price"/></td>
                        <td style="border: 0;border-bottom: 1px dashed;">
                            <br/>
                            <s:property value="currency"/></td>
                        <td style="border: 0;border-bottom: 1px dashed;"><s:property value="levymode"/></td>
                    </tr>
                </s:iterator>
                <tr>
                    <td colspan="9" align="right" style="border: 0;border-top: 1px dashed;">
                        总值：${declare.total_money }</td>
                </tr>
                <tr>
                    <td colspan="9" align="center" style="border: 0;border-top: 1px dashed;">*****以下空白*****</td>
                </tr>
            </table>
        </td>
    </tr>
    </tbody>
</table>